package com.ylr.blog.framework.service.impl;

import com.ylr.blog.framework.service.PublishBlogService;
import com.ylr.blog.framework.entity.PublishBlogEntity;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ylr.blog.framework.mapper.PublishBlogMapper;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-05-18 21:39:36
 * className: PublishBlogServiceImpl
 * version: 1.0
 * description:
 */
@Service("publishBlogService")
public class PublishBlogServiceImpl extends ServiceImpl<PublishBlogMapper, PublishBlogEntity> implements PublishBlogService {

    private static final Logger log = LoggerFactory.getLogger(PublishBlogServiceImpl.class);

    @Override
    public void savePublishBlog(Long blogId, Long userId) {
        PublishBlogEntity publishBlog = new PublishBlogEntity();
        publishBlog.setBlogId(blogId)
                .setUserId(userId);
        // 保存数据
        baseMapper.insert(publishBlog);
        log.info("保存已发布博客完成");
    }
}